// Copyright (c) 2019-present, Facebook, Inc.
// All rights reserved.
//
// This source code is licensed under the license found in the
// LICENSE file in the root directory of this source tree.
//

#include <iostream>
#include <cstdlib>
#include <string>
#include <vector>
#include <fstream>
#include <iomanip>
#include <bits/stdc++.h>
using namespace std;
void f_gold ( int arr [ ], int n ) {
  int max_idx = n - 1, min_idx = 0;
  int max_elem = arr [ n - 1 ] + 1;
  for ( int i = 0;
  i < n;
  i ++ ) {
    if ( i % 2 == 0 ) {
      arr [ i ] += ( arr [ max_idx ] % max_elem ) * max_elem;
      max_idx --;
    }
    else {
      arr [ i ] += ( arr [ min_idx ] % max_elem ) * max_elem;
      min_idx ++;
    }
  }
  for ( int i = 0;
  i < n;
  i ++ ) arr [ i ] = arr [ i ] / max_elem;
}


//TOFILL

int main() {
    int n_success = 0;
    vector<vector<int>> param0 {{1,1,2,3,9,10,14,22,26,28,29,29,30,32,32,32,34,37,39,40,42,42,42,43,45,47,49,52,53,54,56,58,59,68,71,73,76,81,81,83,84,91,94},{50,46,6,-57,67,34,-52,26,-93,97,-84,29,15,-63,65,25,-19,92,-38,-28,89,25,61,-34,-70,-80,88,-18,7,52,32,-63,32,-23,-11,46,-12,94,76,-67,-42},{0,0,0,0,0,0,1,1,1},{15,99,57,69,22,64,41,87,71,56,23,25,91,6,34,63,9,60,49,97,51,60,70,37,31,98,41,62,93,58,14,36,36,79,8,26,36,48,85,28,68,62,80,86,76,80,51},{-99,-99,-90,-90,-85,-85,-79,-77,-72,-71,-67,-66,-61,-39,-39,-35,-35,-23,-20,-18,-16,-13,-2,1,5,6,10,24,27,32,33,38,48,67,70,76,82,88},{0,0,0,1,0,1,0,1,1,1,0,0,0,1,0,0,0,0,1,1,0,0,0,1,0,1,1,0,0,0,1,1,0,1,0,0,1,1,1,1,0,0,0,1,0},{2,22,32,34,43,66,70,74,94,94},{-99,-28,76,-50,41,-85,-47,72,-92,-26,-54,-31,14,47,66,23},{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},{19,31,26,42,41,23,47,13,89,66,66,16,73,28,77,35,41,77,31,85,32,54,98,72,59}};
    vector<int> param1 {29,38,4,30,34,33,6,10,42,20};
    vector<vector<int>> filled_function_param0 {{1,1,2,3,9,10,14,22,26,28,29,29,30,32,32,32,34,37,39,40,42,42,42,43,45,47,49,52,53,54,56,58,59,68,71,73,76,81,81,83,84,91,94},{50,46,6,-57,67,34,-52,26,-93,97,-84,29,15,-63,65,25,-19,92,-38,-28,89,25,61,-34,-70,-80,88,-18,7,52,32,-63,32,-23,-11,46,-12,94,76,-67,-42},{0,0,0,0,0,0,1,1,1},{15,99,57,69,22,64,41,87,71,56,23,25,91,6,34,63,9,60,49,97,51,60,70,37,31,98,41,62,93,58,14,36,36,79,8,26,36,48,85,28,68,62,80,86,76,80,51},{-99,-99,-90,-90,-85,-85,-79,-77,-72,-71,-67,-66,-61,-39,-39,-35,-35,-23,-20,-18,-16,-13,-2,1,5,6,10,24,27,32,33,38,48,67,70,76,82,88},{0,0,0,1,0,1,0,1,1,1,0,0,0,1,0,0,0,0,1,1,0,0,0,1,0,1,1,0,0,0,1,1,0,1,0,0,1,1,1,1,0,0,0,1,0},{2,22,32,34,43,66,70,74,94,94},{-99,-28,76,-50,41,-85,-47,72,-92,-26,-54,-31,14,47,66,23},{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},{19,31,26,42,41,23,47,13,89,66,66,16,73,28,77,35,41,77,31,85,32,54,98,72,59}};
    vector<int> filled_function_param1 {29,38,4,30,34,33,6,10,42,20};
    for(int i = 0; i < param0.size(); ++i)
    {
        f_filled(&filled_function_param0[i].front(),filled_function_param1[i]);
        f_gold(&param0[i].front(),param1[i]);
        if(equal(begin(param0[i]), end(param0[i]), begin(filled_function_param0[i])) && param1[i] == filled_function_param1[i])
        {
            n_success+=1;
        }
    }
    cout << "#Results:" << " " << n_success << ", " << param0.size();
    return 0;
}